<?php
/**
 * @brief Config file.
 * 
 * @license		http://www.gnu.org/licenses/gpl-3.0.txt GNU General Public License
 * @copyright	2008 David Singer
 * @author		David Singer <david@ramaboo.com>
 * @version		1.0.0
 */


define('USERNAME', 'demo'); // lower case only!
define('PASSWORD', 'demo'); // case sensitive

define('DB_CONNECTION_STRING', 'mysql:host=localhost;dbname=extbind_dev'); // connection string
define('DB_USERNAME', 'phpdb'); // database username
define('DB_PASSWORD', 'AgjzW7dsd423o62o'); // database password

// for more advanced database options look in extbind/classes/DB.php
define('DB_DRIVER', 'mysql'); // this version is mysql only odbc, bdb, and postgres will be supported soon

// set database specific constants
switch(DB_DRIVER) {
	case 'mysql':
		define('DB_VERSION', mysql_get_client_info());
		break;
	
	case 'odbc': case 'bdb': case 'postgres': case '':
		define('DB_VERSION', 'unknown');
		break;
	
	default:
		throw new Exception("DB_DRIVER is not valid");
}

// TODO add support for conf
define('BIND_DRIVER', 'dlz'); 

// ip address of bind server
define('BIND_IP', $_SERVER['SERVER_ADDR']);

// apsolute path to named.conf
define('BIND_NAMED_CONF', '/etc/named.conf');

// try to discover bind version
@$bind_version = substr(exec('named -v'), 5);
// set bind version to unknown if it cannot be discoverd
if (!$bind_version) { $bind_version = 'unknown'; }
define('BIND_VERSION', $bind_version); // version of bind

// create BASE_URL
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'on') {
	$url = 'https://';
} else {
	$url = 'http://';
}
$url .= $_SERVER['SERVER_NAME'] . substr($_SERVER['REQUEST_URI'], 0, strripos($_SERVER['REQUEST_URI'], '/') + 1);

// http://yourdomain.com/yourdir/
define('BASE_URL', $url); // include trailing backslash

// the log file may contain sensitive information
// set LOG_FILE to false to disable logging
define('LOG_FILE', '/var/log/phpbind.log');

define('DEBUG', true); // set to false in a production enviroment
define('VERSION', '0.2.2'); // current version

// eof